<?php
/**
 * 用户验证器
 * Created by PhpStorm.
 * User: blue
 * Date: 2017/11/8
 * Time: 9:15
 */

namespace aop\validate;


use think\Validate;

class Member extends Validate
{
    //验证规则
    protected $rule=[
        'mid'=>'require|token',
        'mname'=>'require',
        'password'=>'require',
        'confPassword'=>'require|confirm:password',
        'file.img'=>'fileExt:exe'
    ];
    //验证消息
    protected $message=[
        'mid.require'=>"没有选中的项目",
        'mname.require'=>"用户名必须填写",
        // 'mname.between'=>"用户名必须大于6位",
        'password.require'=>"密码必须填写",
        'confPassword.require'=>'确认密码必须填写',
        'confPassword.confirm'=>'两次密码不一致',
        'file.img.fileExt'=>'图片类型不支持'
    ];
    //验证场景
    protected $scene=[
        'add'=>['mname','password','confPassword'],
        'edit'=>['mname','file.img'],
        'del'=>['mid'],
        'repwd'=>['password','confpassword']
    ];

}